Commands

Editing keybindings

Expression
  • expr = true

    • This allows the function return to be interpreted correctly as a command in Neovim.

Recursive and Non-Recursive
  • remap  is an option  that makes mappings work recursively. By default, it is on and I'd recommend you leave it that way. The rest are mapping commands , described below:

  • :map  and :noremap  are recursive  and non-recursive  versions of the various mapping commands. For example, if we run:

    :map j gg           (moves the cursor to the first line)
    :map Q j            (moves the cursor to the first line)
    :noremap W j        (moves the cursor down one line)
    
  • Then:

    • j  will be mapped to gg .

    • Q  will also  be mapped to gg , because j  will be expanded for the recursive mapping.

    • W  will be mapped to j  (and not to gg ) because j  will not be expanded for the non-recursive mapping.

  • For each of these sets of mappings, there is a mapping that works in normal, visual, select and operator modes ( :map  and :noremap ), one that works in normal mode ( :nmap  and :nnoremap ), one in visual mode ( :xmap  and :xnoremap ) and so on.

  • Mode letters:

    • n : normal only

    • v : visual and select

    • o : operator-pending

    • x : visual only

    • s : select only

    • i : insert

    • c : command-line

    • l : insert, command-line, regexp-search (and others. Collectively called "Lang-Arg" pseudo-mode)

Remove keybinds
  • You can't unmap  internal keybindings that vim needs but you can map them to <Nop>  to disable them.

    • <Nop>  is 'no operation'. It's a way to disable behavior.

  • "Try adding vim.keymap.del("n", "<leader>L")  to config/keymaps.lua ".

    • Maybe this only works with keybindings that are not internal.

  • Remove all default keybindings .

    • "Right now the solution is to map the items you want mapped and let them override the defaults, and any remaining defaults that you don't want to have you can map to "none" "

See shortcuts
  • Table with default shortcuts .

  • :map

    • Only shows user or plugin remaps.

    • :nmap  for normal mode mappings

    • :vmap  for visual mode mappings

    • :imap  for insert mode mappings

  • :Telescope keymaps

    • Only shows user or plugin remaps.

  • Keyseer .

    • :KeySeer

Open NVim

  • nvim .

    • opens nvim in the current directory, showing a list of folders

    • by default, the file structure is shown with NetRW, a file manager from nvim

  • nvim file_name.lua

    • opens the given file in nvim

Help

Commands

  • :

    • nvim command

  • :!

    • external commands

  • @:

    • repeat last ex command

  • @@

    • after repeating it once, you can continue repeating with this

  • ctrl d

    • while typing a command, ctrl d will show a list of commands that completes the one you're typing

    • use tab to scroll through the completions

Terminal

[  ]